const Router = require('koa-router')
let homeController = require('../controllers/home')
let pageController = require('../controllers/page')
let home = new Router()

// 子路由1
home.get('/', homeController)

// 子路由2
let page = new Router()
page.get('/detail', pageController.detail)

// 装载所有子路由
let router = new Router()
router.use('/', home.routes(), home.allowedMethods())
router.use('/page', page.routes(), page.allowedMethods())

module.exports = router
